package gameStates.absGamesStates.gui;

import main.listeners.listenerClasses.gui.ChatActivatedEvent;
import main.listeners.listenerClasses.gui.ConsoleToggleEvent;
import main.listeners.listenerClasses.gui.GUIListener;
import main.listeners.listenerClasses.gui.IngameChangedEvent;
import main.listeners.listenerClasses.gui.ScoreBoardToggleEvent;
import main.listeners.listenerClasses.gui.SpawnMenuChangedEvent;
import gameStates.gui.GUIState;
import gameStates.passes.AbsPassManagerState;

public abstract class AbsScoreBoardState extends GUIState {
	
	public AbsScoreBoardState(AbsPassManagerState passManagerState, boolean init) {
		super("show players", passManagerState, init);
		
		addListenerToClearer(new GUIListener() {
			@Override
			public void spawnMenuChanged(SpawnMenuChangedEvent event) {
				setActive(false);
			}
			
			@Override
			public void scoreBoardToggled(ScoreBoardToggleEvent event) {
				setActive(event.scoreBoardIsActive());
			}
			
			@Override
			public void ingameChanged(IngameChangedEvent event) {
				setActive(false);
			}

			@Override
			public void consoleToggled(ConsoleToggleEvent event) {
				enableInput(!event.getValue());
			}
			
			@Override
			public void chatActivated(ChatActivatedEvent event) {}
		});
		
		putAtSecondEnd();
	}
}